cumulative = 0
empty_bottle = eval(input(""))

while True:
    bottle = empty_bottle // 3
    empty_bottle = empty_bottle % 3 + bottle

    cumulative += bottle

    if empty_bottle == 2:
        cumulative += 1
        break
    elif empty_bottle == 1:
        break

print(cumulative)
